package com.hudongwx.shansun.activity;

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.hudongwx.shansun.R;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

@ContentView(R.layout.activity_buy_close)
public class BuyCloseActivity extends AppCompatActivity {
    @ViewInject(R.id.buy_close_tab)
    private TabLayout tabLayout;
    @ViewInject(R.id.buy_close_view)
    private ViewPager viewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        x.view().inject(this);
        String link = getIntent().getStringExtra("specialId");
        String goodsId = getIntent().getStringExtra("goodsId");
        tabLayout.setupWithViewPager(viewPager);

        TabLayout.Tab tab1 = tabLayout.newTab().setCustomView(R.layout.buy_service);
        TabLayout.Tab tab2 = tabLayout.newTab().setCustomView(R.layout.buy_shop);
        TabLayout.Tab tab3 = tabLayout.newTab().setCustomView(R.layout.buy_like);
        TabLayout.Tab tab4 = tabLayout.newTab().setText("加入购物车");
        TabLayout.Tab tab5 = tabLayout.newTab().setText("闪降购买");
        tabLayout.addTab(tab1);
        tabLayout.addTab(tab2);
        tabLayout.addTab(tab3);
        tabLayout.addTab(tab4);
        tabLayout.addTab(tab5);



    }

    class MyViewpager extends FragmentStatePagerAdapter{
        public MyViewpager(FragmentManager fm) {
            super(fm);
        }

        @Override
        public Fragment getItem(int position) {
            switch (position){
                case 0:

                    break;

            }
            return null;
        }

        @Override
        public int getCount() {
            return 0;
        }
    }
}
